package cn.autumnorange.repository;

import cn.autumnorange.entity.OrderEntity;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;

import java.util.List;

/**
 * @InterfaceName OrderMasterRepository
 * @Description
 * @Date 2019/1/21 11:06
 * @Version 1.0
 */
public interface OrderRepository extends JpaRepository<OrderEntity, String> {
    /** 订单搜索 */
    Page<OrderEntity> findByBuyerPhoneContainingOrderByCreateTimeDesc(String buyerPhone, Pageable pageable);

    /** 审核订单列表 */
    Page<OrderEntity> findAllByOrderStatusOrderByCreateTimeDesc(int orderStatus, Pageable pageable);

    /** 发货订单列表 */
    Page<OrderEntity> findAllByDeliveryStatusAndOrderStatusOrderByCreateTimeDesc(int deliveryStatus, int orderStatus, Pageable pageable);

    /** 订单详情 */
    OrderEntity findByOrderId(String OrderId);
}
